// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT
// IT'S ALL JUST JUNK FOR OUR DOCS!
// ++++++++++++++++++++++++++++++++++++++++++

!function ($) {
	$(function(){
		var $window = $(window)
		$('#banner').slidesjs({
			height: 393,
			navigation: {
			  effect: "fade"
			},
			pagination: {
			  effect: "fade"
			},
			effect: {
			  fade: {
				speed: 400
			  }
			},
			play: {
			  auto: true,
			  interval: 4000,
			  swap: true
			}
		  });
		$('#slides, #testimonial').slides({
			preload: true,
			generateNextPrev: true
		});
		
		$('#readLink').live('click',function(){
			$('#testimonial .next').click();
		});
		$('#slide,#slidetwo').ulslide({
			statusbar: true,
			height: 300,
			nextButton: '#slide_next',
			effect: {
				type: 'slide',
				axis: 'y',
				distance: 8
			},
			mousewheel: true,
			duration: 400
		});
		 $('#spotlight').ulslide({
			statusbar: true,
			height: 325,
			nextButton: '#spotlight_next',
			effect: {
				type: 'slide',
				axis: 'y',
				distance: 8
			},
			mousewheel: true,
			duration: 400
		});
		$('#wherewego').ulslide({
			statusbar: true,
			height: 290,
			nextButton: '#wherewego_next',
			effect: {
				type: 'slide',
				axis: 'y',
				distance: 8
			},
			mousewheel: true,
			duration: 400
		});
		$('#products, #productstwo').slides({
			preload: true,
			preloadImage: 'images/loading.gif',
			effect: 'slide, fade',
			crossfade: true,
			slideSpeed: 350,
			fadeSpeed: 500,
			generateNextPrev: true,
			generatePagination: false
		});
		
		$('#wheretosay').roundabout();
		$('#date-from, #date-to').datepicker({
			format: 'dd/mm/yy'
		});
		$('#carouTourt-1').carouFredSel({
			responsive: true,
			width: '96%',
			scroll: 2,
			prev: '#aPrev1',
			next: '#aNext1',
			auto: false,
			items: {
				width: 205,
				height: 140,
				visible: {
					min: 2,
					max: 6
				}
			}
		});
		$('#carouTourt-2').carouFredSel({
			responsive: true,
			width: '96%',
			scroll: 2,
			prev: '#aPrev2',
			next: '#aNext2',
			auto: false,
			items: {
				width: 205,
				height: 140,
				visible: {
					min: 2,
					max: 6
				}
			}
		});
		$('#carouTourt-3').carouFredSel({
			responsive: true,
			width: '96%',
			scroll: 2,
			prev: '#aPrev3',
			next: '#aNext3',
			auto: false,
			items: {
				width: 205,
				height: 140,
				visible: {
					min: 2,
					max: 6
				}
			}
		});
		$('#carouTourt-4').carouFredSel({
			responsive: true,
			width: '96%',
			scroll: 2,
			prev: '#aPrev4',
			next: '#aNext4',
			auto: false,
			items: {
				width: 205,
				height: 140,
				visible: {
					min: 2,
					max: 6
				}
			}
		});
		$('#slide-out').carouFredSel({
			responsive: true,
			width: '90%',
			scroll: 1,
			prev: '#prev-out',
			next: '#next-out',
			auto: true,
			items: {
				width: 205,
				height: 50,
				visible: {
					min: 2,
					max: 6
				}
			}
		});
		$(".nav > li").bind({
			
				mouseenter: function(){
					if($(window).width() > 766){
						$(this).addClass('open');
					}
				},
				mouseleave: function(){
					if($(window).width() > 766){
						$(this).removeClass('open');
					}
				}
		});
		$(".useful_info > a").click(function(e){
			$(".useful_info .cont").slideUp("fast");
			if($(this).next(".cont").is(":hidden"))
			{
				$(this).next(".cont").slideToggle(150);
			}
			return e.preventDefault();
		});
		setInterval((function() {
          if ($(window).width()<=766) {
			  $(".menu .nav > li > a").attr('data-toggle','dropdown');
          }else{
			  $(".menu .nav > li > a").attr('data-toggle','');
			}
        }), 250);
	})
}(window.jQuery)
